package com.xing.demo;

import java.util.Scanner;

public class Switch月份天数 {
    public static void main(String[] args) {
        System.out.println("请输入一个月份");
        Scanner input = new Scanner(System.in);
        int month = input.nextInt();
        switch (month){
            case 1:
            case 3:
            case 5:
            case 7:
            case 8:
            case 10:
            case 12:
                System.out.println(month+"月有31天");
                break;
            case 2:
                System.out.println(month+"月有28天");
                break;
            case 4:
            case 6:
            case 9:
            case 11:
                System.out.println(month+"月有30天");
                break;
            default:
                System.out.println("输入有误，请重新输入");
                break;
        }


    }
}
